<@ms.html5>
<style>
	.table-hover{
		table-layout:fixed;
	}
	.table-hover td{
		overflow:hidden;
		text-overflow:ellipsis;
		white-space:nowrap;
	}
</style>
  	<link rel="stylesheet" type="text/css" href="${basePath}/static/plugins/bootstrap.star.rating/star-rating.min.css"></link>
	<script type="text/javascript" src="${basePath}/static/plugins/bootstrap.star.rating/star-rating.min.js"></script>
	<@ms.nav title="服务评价" back=true></@ms.nav>
	<@ms.panel>
				<@ms.searchForm  name="searchForm" id="searchForm" action="${managerPath}/comment/list.do">
							<@ms.date label="评价时间" name="commentTime" value="${commentTime?default('')}" />
							<#assign types=[{"id":"-1","name":"全部"},{"id":"1","name":"钣喷喷漆"},{"id":"2","name":"在线咨询"}]>
							<@ms.select label="评价类型" list=types listValue="name" listKey="id"    name="commentType" value="${commentType?default(-1)}" />
						<@ms.searchFormButton>
								<@ms.queryButton id="submitSearch"/>								
						</@ms.searchFormButton>
				</@ms.searchForm>
				
				<@ms.table head=['<th class="text-center" width="5%">序号</th>','<th class="text-center" width="15%">评价时间</th>','<th class="text-center" width="10%">评价类型</th>','<th class="text-center" width="20%">评价对象</th>','<th class="text-center" width="20%" >评分</th>','<th class="text-center" width="30%">评价内容</th>']>
						<#if commentList?has_content>
		        			<#list commentList as comment>
		           				<tr>
		           					<td class="text-center">${comment_index+1}</td>
						            <td class="text-center">${comment.commentTime?string("yyyy-MM-dd HH:mm:ss")}</td>
						            <td class="text-center">
						            <#if comment.commentType == 1>  
						            	钣金喷漆
						            <#elseif comment.commentType == 2>
						            	在线咨询
						            </#if>
						            </td>
						            <td class="text-center" title="${comment.commentObject?default("-")}">${comment.commentObject?default("-")}</td>
						            <td class="text-center" style="text-align:left;"><input name="rating-commentScore" type="number" value="${comment.commentScore}"/></td>
						            <td class="text-center" title="${comment.commentContent?default("-")}">${comment.commentContent?default("-")}</td>
						        </tr>
		           			</#list>
		           		<#else>	
			           		<tr>
						         <td colspan="6" class="text-center">
						            <@ms.nodata/>
								</td>
					        </tr>
		           		</#if>
					</@ms.table>
					<!--分页样式 开始-->
					<#if page?has_content>
						<@ms.pagehelper page=page url="${managerPath}/comment/list.do?${params}"/>
					</#if>	
	</@ms.panel>
</@ms.html5>
<script>
	$(function(){
		//根据条件查询反馈
		$("#submitSearch").click(function() {
			$("#searchForm")[0].submit();
		});
		 $("input[name='rating-commentScore']").each(function(){
    		$(this).rating({
              min: 0,
              max: 5,
              step: 1,
              size: 'xs',
              readonly: true,
              showClear: false
           });
  		});
	});
	//js监听回车键 
	document.onkeydown = function(e) {
		e = e ? e : window.event;
		var keyCode = e.which ? e.which : e.keyCode;
		if (keyCode == 13) {
			$("#searchForm")[0].submit();
		}
	}
</script>